<template>
  <div class="err">
    <img src="../assets/imgs/404.jpg" alt="" />
    <p class="prt">你的页面还有{{ num }}秒回到登录页面!</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: 5
    }
  },
  created() {
    setInterval(() => {
      this.num--
      if (this.num === 0) {
        this.$router.push('/login')
      }
    }, 1000)
  }
}
</script>

<style lang="less" scoped>
.err {
  height: 100%;
  display: flex;
  justify-content: center;
  align-content: center;
  flex-direction: column;
  .prt {
    text-align: center;
    color: orangered;
  }
  img {
    height: 70%;
  }
}
</style>
